package com.resolution.dietaryassessment.view.tcm.bean;

import java.util.List;

/**
 * @author By Resolusion
 * @Title:
 * @Date: 2020/4/7
 * @Time: 20:59
 * @email Res01ution@foxmail.com
 */
public enum  TCMEnum {
    PEACE(0,"平和质") , QIXU(1,"气虚质") ,
    YANGXU(2,"阳虚质") , YINXU(3,"阴虚质") ,
    TANSHI(4,"痰湿质") , SHIRE(5,"湿热质") ,
    XUEYU(6,"血瘀质") , QIYU(7,"气郁质") ,
    TEBING(8,"特禀质");

    private int index;
    private String name;

    TCMEnum(int index, String name){
        this.index = index;
        this.name = name;
    }

    public static String getName(List<Integer> indexList, int max) {
        StringBuilder builder = new StringBuilder();
        for (int i:indexList){
            if (i == max){
                continue;
            }
            for (TCMEnum t : TCMEnum.values()){
                if (t.getIndex() == i){
                    builder.append(t.getName()).append("、");
                }
            }
        }
        return builder.toString().substring(0,builder.length()-1);
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public int getIndex() {
        return index;
    }

    public void setIndex(int index) {
        this.index = index;
    }
}
